import { createRouter, createWebHistory } from "vue-router";
import App from "@/App.vue";
import Home from "@/pages/Home.vue";
import MainIndex from "@/views/main/MainIndex.vue";
import JsonIndex from "@/views/json/JsonIndex.vue";

const routes = [
  {
    path: "/",
    component: App,
    children: [
      {
        path: "",
        name: "Home",
        component: Home,
        children: [
          {
            path: "",
            name: "MainIndex",
            component: MainIndex,
          },
          {
            path: "json-index",
            name: "JsonIndex",
            component: JsonIndex,
          },
        ],
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
